package com.easondongh.blog.enums;

import lombok.Getter;

/**
 * 结果返回枚举
 * @author EasonDongH
 * @date 2020/3/19 10:39
 */
@Getter
public enum  ResultEnum {
    /**
     * 返回结果枚举，每个枚举代表着一个返回状态
     */
    SUCCESS(20000, "操作成功"),
    BLOG_SAVE_SUCCESS(20000, "新增博客成功"),
    UPLOAD_IMAGE_SUCCESS(20000, "图片上传成功"),
    UPDATE_PASSWORD_SUCCESS(20000, "密码修改成功，请重新登录"),
    RESET_PASSWORD_SUCCESS(20000, "密码重置成功"),
    REGISTER_SUCCESS(20000, "注册成功，请登录"),

    ERROR(40000, "操作失败"),
    DATA_NOT_FOUND(40001, "查询失败"),
    PARAMS_NULL(40002, "参数不能为空"),
    NOT_LOGIN(40003, "未登录，请先登录"),
    PARAMS_ERROR(40004, "参数不合法"),
    USER_NOT_FOUND(40005, "用户不存在"),
    INVALID_USERNAME_OR_PASSWORD(40006, "用户名或密码错误"),
    BLOG_TYPE_ALREADY_EXIST(40007, "该博客分类已存在"),
    ABOUT_IS_EXIST(40008, "【关于我】已存在"),
    USERNAME_IS_EXIST(40008, "用户名已存在")
    ;
    private Integer code;
    private String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
